package com.yesallchina.wxapp.officialaccount.api.beans;



import java.io.Serializable;

public class AccessToken implements Serializable{
    private String accessToken;
    private long lastDate = 0;
    private String appId;
    private String publicId;
    private String refreshToken;

    private long interval = 7200*1000;

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public long getLastDate() {
        return lastDate;
    }

    public void setLastDate(long lastDate) {
        this.lastDate = lastDate;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getPublicId() {
        return publicId;
    }

    public void setPublicId(String publicId) {
        this.publicId = publicId;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public long getInterval() {
        return interval;
    }

    public void setInterval(long interval) {
        this.interval = interval;
    }

    public boolean isDateline(){
        if (System.currentTimeMillis() - lastDate > interval){
            return true;
        }
        return false;
    }

}
